Fast, Flexible Syntactic Pattern Matching and Processing
نویسندگان
چکیده
Program understanding can be assisted by tools that match patterns in the program source. Lexical pattern matchers provide excellent performance and ease of use, but have a limited vocabulary. Syntactic matchers provide more precision, but may sacrifice performance, retargetability, ease of use, or generality. To achieve more of the benefits of both models, we extend the pattern syntax of AWK to support matching of abstract syntax trees, as demonstrated in a tool called TAWK. Its pattern syntax is language-independent, based on abstract tree patterns. As in AWK, patterns can have associated actions, which in TAWK are written in C for generality, familiarity, and performance. The use of C is simplified by high-level libraries and dynamic linking. To allow processing of program files containing non-syntactic constructs, mechanisms have been designed that allow transparent matching in a syntactic fashion. So far, TAWK has been retargeted to the MUMPS and C programming languages. We survey and apply prototypical approaches to concretely demonstrate the tradeoffs. Our results indicate that TAWK can be used to quickly and easily perform a variety of common software engineering tasks, and the extensions to accommodate non-syntactic features significantly extend the generality of syntactic matchers.
منابع مشابه
Fuzzy Relative Position Between Objects in Image Processing: A Morphological Approach
In order to cope with the ambiguity of spatial relative position concepts, we propose a new definition of the relative position between two objects in a fuzzy set framework. This definition is based on a morphological and fuzzy pattern-matching approach, and consists of comparing an object to a fuzzy landscape representing the degree of satisfaction of a directional relationship to a reference ...
متن کاملFlexible Syntactic Matching of Curves and Its Application to Automatic Hierarchical Classification of Silhouettes
ÐCurve matching is one instance of the fundamental correspondence problem. Our flexible algorithm is designed to match curves under substantial deformations and arbitrary large scaling and rigid transformations. A syntactic representation is constructed for both curves and an edit transformation which maps one curve to the other is found using dynamic programming. We present extensive experimen...
متن کاملA fast partial parse of natural language
The pattern matching capabilities of neural networks can be used to locate syntactic constituents of natural language. This paper describes a fully automated hybrid system, using neural nets operating within a grammatic framework. It addresses the representation of language for connectionist processing, and describes methods of constraining the problem size. The function of the network is briee...
متن کاملA fast partial parse of natural language sentences using a connectionist method
The pattern matching capabilities of neural networks can be used to loc ate syntactic constituents of natural lan guage This paper describes a fully auto mated hybrid system using neural nets operating within a grammatic frame work It addresses the representation of language for connectionist processing and describes methods of constraining the problem size The function of the network is brie y...
متن کاملA New Pattern Matching Approach to the Recognition of Printed Arabic
The paper presents a new segmentation-free approach to the Arabic optical character recognition. Extended with a suitable preand post-processing the method offers a simple and fast framework to develop a full OCR system. The method was developed primarily for the Naskhi font, it is however robust and flexible and can be easily extended.
متن کامل